package org.example.cloud.controller;

import cn.hutool.core.util.IdUtil;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.example.cloud.entities.Pay;
import org.example.cloud.service.PayService;
import org.example.cloud.util.ResultData;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 宋孟林
 * @description
 * @date: 2025/4/8 16:14
 */
@RestController
@Slf4j
public class PayGateWayController {
    @Resource
    PayService payService;
    @GetMapping(value = "/pay/gateway/get/{id}")
    public ResultData<Pay> getById(@PathVariable("id") Integer id) {
        log.info("网关----服务提供者根据id获取pay信息方法执行");
        Pay pay = payService.getById(id);
        return ResultData.success(pay);
    }

    @GetMapping(value = "/pay/gateway/info")
    public ResultData<String> getGatewayInfo() {
        return ResultData.success("gateway info test：" + IdUtil.simpleUUID());
    }
}